package com.brooks.demo;

/**
 * @author Maoyan
 * @data 2020/10/18 14:50
 * @Version 1.0.0
 */
public class StaticProxy {
    public static void main(String[] args) {
        WeddingCompany we = new WeddingCompany(new You());
        we.HappyMarry();
    }
}

interface Marry{
    void HappyMarry();
}

class You implements Marry {

    public void HappyMarry() {
        System.out.println("结婚了，很开心");
    }
}

class WeddingCompany implements Marry {

    private You target;

    public WeddingCompany(You target) {
        this.target = target;
    }

    public void HappyMarry() {
        before();
        this.target.HappyMarry();
        after();
    }

    private void after() {
        System.out.println("结婚之后，收拾东西");
    }

    private void before() {
        System.out.println("结婚之前，布置现场");
    }


}
